﻿using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using PortaCapena.OdooJsonRpcClient.Attributes;
using PortaCapena.OdooJsonRpcClient.Converters;
using PortaCapena.OdooJsonRpcClient.Models;
using System;
using System.ComponentModel;
using System.Runtime.Serialization;

namespace OdooRpcClient.Model.Base
{
    [OdooTableName("res.company")]
    [JsonConverter(typeof(OdooModelConverter))]
    public class ResCompanyOdooModel : IOdooModel
    {

        /// <summary>
        /// Name
        /// Char
        /// required
        /// <summary>
        [JsonProperty("name")]
        [Description("Name")]
        public string Name { get; set; }

        /// <summary>
        /// Sequence
        /// Integer
        /// Used to order Companies in the company switcher
        /// <summary>
        [JsonProperty("sequence")]
        [Description("Sequence")]
        public int? Sequence { get; set; }

        /// <summary>
        /// ParentId
        /// Many2one
        /// res.company
        /// <summary>
        [JsonProperty("parent_id")]
        [Description("ParentId")]
        public long? ParentId { get; set; }

        /// <summary>
        /// ChildIds
        /// One2many
        /// res.company
        /// parent_id
        /// <summary>
        [JsonProperty("child_ids")]
        [Description("ChildIds")]
        public long[] ChildIds { get; set; }

        /// <summary>
        /// PartnerId
        /// Many2one
        /// required
        /// res.partner
        /// <summary>
        [JsonProperty("partner_id")]
        [Description("PartnerId")]
        public long PartnerId { get; set; }

        /// <summary>
        /// ReportHeader
        /// Text
        /// Appears by default on the top right corner of your printed documents (report header).
        /// <summary>
        [JsonProperty("report_header")]
        [Description("ReportHeader")]
        public string ReportHeader { get; set; }

        /// <summary>
        /// ReportFooter
        /// Text
        /// Footer text displayed at the bottom of all reports.
        /// <summary>
        [JsonProperty("report_footer")]
        [Description("ReportFooter")]
        public string ReportFooter { get; set; }

        /// <summary>
        /// Logo
        /// Binary
        /// <summary>
        [JsonProperty("logo")]
        [Description("Logo")]
        public string Logo { get; set; }

        /// <summary>
        /// LogoWeb
        /// Binary
        /// <summary>
        [JsonProperty("logo_web")]
        [Description("LogoWeb")]
        public string LogoWeb { get; set; }

        /// <summary>
        /// CurrencyId
        /// Many2one
        /// required
        /// res.currency
        /// <summary>
        [JsonProperty("currency_id")]
        [Description("CurrencyId")]
        public long CurrencyId { get; set; }

        /// <summary>
        /// UserIds
        /// Many2many
        /// res.users
        /// <summary>
        [JsonProperty("user_ids")]
        [Description("UserIds")]
        public long[] UserIds { get; set; }

        /// <summary>
        /// Street
        /// Char
        /// <summary>
        [JsonProperty("street")]
        [Description("Street")]
        public string Street { get; set; }

        /// <summary>
        /// Street2
        /// Char
        /// <summary>
        [JsonProperty("street2")]
        [Description("Street2")]
        public string Street2 { get; set; }

        /// <summary>
        /// StreetName
        /// Char
        /// <summary>
        [JsonProperty("street_name")]
        [Description("StreetName")]
        public string StreetName { get; set; }

        /// <summary>
        /// StreetNumber
        /// Char
        /// <summary>
        [JsonProperty("street_number")]
        [Description("StreetNumber")]
        public string StreetNumber { get; set; }

        /// <summary>
        /// StreetNumber2
        /// Char
        /// <summary>
        [JsonProperty("street_number2")]
        [Description("StreetNumber2")]
        public string StreetNumber2 { get; set; }

        /// <summary>
        /// Zip
        /// Char
        /// <summary>
        [JsonProperty("zip")]
        [Description("Zip")]
        public string Zip { get; set; }

        /// <summary>
        /// City
        /// Char
        /// <summary>
        [JsonProperty("city")]
        [Description("City")]
        public string City { get; set; }

        /// <summary>
        /// StateId
        /// Many2one
        /// res.country.state
        /// <summary>
        [JsonProperty("state_id")]
        [Description("StateId")]
        public long? StateId { get; set; }

        /// <summary>
        /// BankIds
        /// One2many
        /// Bank accounts related to this company
        /// res.partner.bank
        /// company_id
        /// <summary>
        [JsonProperty("bank_ids")]
        [Description("BankIds")]
        public long[] BankIds { get; set; }

        /// <summary>
        /// CountryId
        /// Many2one
        /// res.country
        /// <summary>
        [JsonProperty("country_id")]
        [Description("CountryId")]
        public long? CountryId { get; set; }

        /// <summary>
        /// Email
        /// Char
        /// <summary>
        [JsonProperty("email")]
        [Description("Email")]
        public string Email { get; set; }

        /// <summary>
        /// Phone
        /// Char
        /// <summary>
        [JsonProperty("phone")]
        [Description("Phone")]
        public string Phone { get; set; }

        /// <summary>
        /// Website
        /// Char
        /// <summary>
        [JsonProperty("website")]
        [Description("Website")]
        public string Website { get; set; }

        /// <summary>
        /// Vat
        /// Char
        /// The Tax Identification Number. Complete it if the contact is subjected to government taxes. Used in some legal statements.
        /// <summary>
        [JsonProperty("vat")]
        [Description("Vat")]
        public string Vat { get; set; }

        /// <summary>
        /// CompanyRegistry
        /// Char
        /// <summary>
        [JsonProperty("company_registry")]
        [Description("CompanyRegistry")]
        public string CompanyRegistry { get; set; }

        /// <summary>
        /// PaperformatId
        /// Many2one
        /// report.paperformat
        /// <summary>
        [JsonProperty("paperformat_id")]
        [Description("PaperformatId")]
        public long? PaperformatId { get; set; }

        /// <summary>
        /// ExternalReportLayoutId
        /// Many2one
        /// ir.ui.view
        /// <summary>
        [JsonProperty("external_report_layout_id")]
        [Description("ExternalReportLayoutId")]
        public long? ExternalReportLayoutId { get; set; }

        /// <summary>
        /// BaseOnboardingCompanyState
        /// Selection
        /// <summary>
        [JsonProperty("base_onboarding_company_state")]
        [Description("BaseOnboardingCompanyState")]
        public StateOfTheOnboardingCompanyStepResCompanyOdooEnum? BaseOnboardingCompanyState { get; set; }

        /// <summary>
        /// Favicon
        /// Binary
        /// This field holds the image used to display a favicon for a given company.
        /// <summary>
        [JsonProperty("favicon")]
        [Description("Favicon")]
        public string Favicon { get; set; }

        /// <summary>
        /// Font
        /// Selection
        /// <summary>
        [JsonProperty("font")]
        [Description("Font")]
        public FontResCompanyOdooEnum? Font { get; set; }

        /// <summary>
        /// PrimaryColor
        /// Char
        /// <summary>
        [JsonProperty("primary_color")]
        [Description("PrimaryColor")]
        public string PrimaryColor { get; set; }

        /// <summary>
        /// SecondaryColor
        /// Char
        /// <summary>
        [JsonProperty("secondary_color")]
        [Description("SecondaryColor")]
        public string SecondaryColor { get; set; }

        /// <summary>
        /// ResourceCalendarIds
        /// One2many
        /// resource.calendar
        /// company_id
        /// <summary>
        [JsonProperty("resource_calendar_ids")]
        [Description("ResourceCalendarIds")]
        public long[] ResourceCalendarIds { get; set; }

        /// <summary>
        /// ResourceCalendarId
        /// Many2one
        /// resource.calendar
        /// <summary>
        [JsonProperty("resource_calendar_id")]
        [Description("ResourceCalendarId")]
        public long? ResourceCalendarId { get; set; }

        /// <summary>
        /// CatchallEmail
        /// Char
        /// <summary>
        [JsonProperty("catchall_email")]
        [Description("CatchallEmail")]
        public string CatchallEmail { get; set; }

        /// <summary>
        /// CatchallFormatted
        /// Char
        /// <summary>
        [JsonProperty("catchall_formatted")]
        [Description("CatchallFormatted")]
        public string CatchallFormatted { get; set; }

        /// <summary>
        /// EmailFormatted
        /// Char
        /// <summary>
        [JsonProperty("email_formatted")]
        [Description("EmailFormatted")]
        public string EmailFormatted { get; set; }

        /// <summary>
        /// HrPresenceControlEmailAmount
        /// Integer
        /// <summary>
        [JsonProperty("hr_presence_control_email_amount")]
        [Description("HrPresenceControlEmailAmount")]
        public int? HrPresenceControlEmailAmount { get; set; }

        /// <summary>
        /// HrPresenceControlIpList
        /// Char
        /// <summary>
        [JsonProperty("hr_presence_control_ip_list")]
        [Description("HrPresenceControlIpList")]
        public string HrPresenceControlIpList { get; set; }

        /// <summary>
        /// PartnerGid
        /// Integer
        /// <summary>
        [JsonProperty("partner_gid")]
        [Description("PartnerGid")]
        public int? PartnerGid { get; set; }

        /// <summary>
        /// SnailmailColor
        /// Boolean
        /// <summary>
        [JsonProperty("snailmail_color")]
        [Description("SnailmailColor")]
        public bool? SnailmailColor { get; set; }

        /// <summary>
        /// SnailmailCover
        /// Boolean
        /// <summary>
        [JsonProperty("snailmail_cover")]
        [Description("SnailmailCover")]
        public bool? SnailmailCover { get; set; }

        /// <summary>
        /// SnailmailDuplex
        /// Boolean
        /// <summary>
        [JsonProperty("snailmail_duplex")]
        [Description("SnailmailDuplex")]
        public bool? SnailmailDuplex { get; set; }

        /// <summary>
        /// Id
        /// Integer
        /// <summary>
        [JsonProperty("id")]
        [Description("Id")]
        public long Id { get; set; }

        /// <summary>
        /// DisplayName
        /// Char
        /// <summary>
        [JsonProperty("display_name")]
        [Description("DisplayName")]
        public string DisplayName { get; set; }

        /// <summary>
        /// CreateUid
        /// Many2one
        /// res.users
        /// <summary>
        [JsonProperty("create_uid")]
        [Description("CreateUid")]
        public long? CreateUid { get; set; }

        /// <summary>
        /// CreateDate
        /// Datetime
        /// <summary>
        [JsonProperty("create_date")]
        [Description("CreateDate")]
        public DateTime? CreateDate { get; set; }

        /// <summary>
        /// WriteUid
        /// Many2one
        /// res.users
        /// <summary>
        [JsonProperty("write_uid")]
        [Description("WriteUid")]
        public long? WriteUid { get; set; }

        /// <summary>
        /// WriteDate
        /// Datetime
        /// <summary>
        [JsonProperty("write_date")]
        [Description("WriteDate")]
        public DateTime? WriteDate { get; set; }

        /// <summary>
        /// LastUpdate
        /// Datetime
        /// <summary>
        [JsonProperty("__last_update")]
        [Description("LastUpdate")]
        public DateTime? LastUpdate { get; set; }
    }


    [JsonConverter(typeof(StringEnumConverter))]
    public enum StateOfTheOnboardingCompanyStepResCompanyOdooEnum
    {
        [EnumMember(Value = "not_done")]
        NotDone = 1,

        [EnumMember(Value = "just_done")]
        JustDone = 2,

        [EnumMember(Value = "done")]
        Done = 3,
    }


    [JsonConverter(typeof(StringEnumConverter))]
    public enum FontResCompanyOdooEnum
    {
        [EnumMember(Value = "Lato")]
        Lato = 1,

        [EnumMember(Value = "Roboto")]
        Roboto = 2,

        [EnumMember(Value = "Open_Sans")]
        OpenSans = 3,

        [EnumMember(Value = "Montserrat")]
        Montserrat = 4,

        [EnumMember(Value = "Oswald")]
        Oswald = 5,

        [EnumMember(Value = "Raleway")]
        Raleway = 6,
    }

}
